UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Joma3XS9jhGm1izcrjif1Ds0qXDjfPH+3g/f2ohNJhA='
WHERE
key_id = '82dfc853b836ca325e48c7515fa98f9c5855f53163c7b6a71fb40f2609bcf6b0'
AND (
token = 'Joma3XS9jhGm1izcrjif1Ds0qXDjfPH+3g/f2ohNJhA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)