UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zxfaedhLCWomOdVZU40G5TwIMYleurBX/ULkSiZ52/Y='
WHERE
key_id = '169608d16cb9ca3adc95076c9a6ecc5159b7399b15ddebce92b7af636a67dddc'
AND (
token = 'zxfaedhLCWomOdVZU40G5TwIMYleurBX/ULkSiZ52/Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)