UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iNpJq68G5VOMsgReQmo/ceR4xmlMWZSC82Iuc57g1SM='
WHERE
key_id = 'ca468527ab7a60617e8031ba21fe2327de9a8070ec9a8271caad19de0c3bba29'
AND (
token = 'iNpJq68G5VOMsgReQmo/ceR4xmlMWZSC82Iuc57g1SM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)