UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ws42CpoxGGZfIyZe5Em/TUPFou1KBwtGiSqoTs4EAD8='
WHERE
key_id = '4005f58dcd951b94a02d7e8f99da244421bf1d0250f6fab04fc7681ff7e39c6b'
AND (
token = 'Ws42CpoxGGZfIyZe5Em/TUPFou1KBwtGiSqoTs4EAD8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)