UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aSInrRy/O7CCvLiwFj6JGI4+KgLY4x9Yue7ImQioBes='
WHERE
key_id = '68a987220db24a84c147e8fd04eea329e67dc357d81b02533486783631b3c985'
AND (
token = 'aSInrRy/O7CCvLiwFj6JGI4+KgLY4x9Yue7ImQioBes='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)