UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i6WQZsuXXkEBd4WPsmBXp/GAaOSl6vFGQFHFCQA8iZo='
WHERE
key_id = 'a534d0bb34e8f2bc3b74f30d39bccae3597e8a8cdb1e20a98072cf8c37c82c25'
AND (
token = 'i6WQZsuXXkEBd4WPsmBXp/GAaOSl6vFGQFHFCQA8iZo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)