UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zs4vyZROsSPeWIPQT9ZZ0IMC9fgqNDSI20lE8AUsq7c='
WHERE
key_id = 'c5b9f63a7d6ff76c0b5caaa86a3e3d6b8d424958ac3aefb6073af079366ca64b'
AND (
token = 'zs4vyZROsSPeWIPQT9ZZ0IMC9fgqNDSI20lE8AUsq7c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)