UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0qYFiR1SZYZ0Eu/GcP5OmoNae1Nd0dxD/HAKQmsnJuc='
WHERE
key_id = 'ef09a8cb462d17427815657ad58b8f142e508eba47b0c62c456c122af855c759'
AND (
token = '0qYFiR1SZYZ0Eu/GcP5OmoNae1Nd0dxD/HAKQmsnJuc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)