UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kztsNSojmohpvZvw7q7ZgW5K79P4eJ6TqHFP/Sbqziw='
WHERE
key_id = 'd8c9ccf1b172c5255d4fa80e5f6b9c05a5b0decf764e3bcfbe23ef18b14c0292'
AND (
token = 'kztsNSojmohpvZvw7q7ZgW5K79P4eJ6TqHFP/Sbqziw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)