UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '71tIxEz15+3peqfii1rY/wg6WWZuxidjingU7DyElyk='
WHERE
key_id = '408e43136ec306e225352a7f4aaab44ed586bdf96824487797fd2faa1f75937a'
AND (
token = '71tIxEz15+3peqfii1rY/wg6WWZuxidjingU7DyElyk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)