UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ik6Ssvcjyb5YAKjcKY/qFUlh9gZXhn7LfXo/o/dgCWY='
WHERE
key_id = '7cccb78f82b6e3f1977d501aa29f007e04d0413cb6df9482c6a9275bebfa377b'
AND (
token = 'ik6Ssvcjyb5YAKjcKY/qFUlh9gZXhn7LfXo/o/dgCWY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)