UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e9tJajeY84N1WKfZAkV3j8TYZ33I9tT9h5xkNNR/3F4='
WHERE
key_id = '96f5a8e3becda29c7805a057559bc8f86181cede85ebda55d3aa5d770b1862e3'
AND (
token = 'e9tJajeY84N1WKfZAkV3j8TYZ33I9tT9h5xkNNR/3F4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)