UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y6gdb5MZwwRZf75lpdsoegnrukPVrYrTpAyaUFtaQVY='
WHERE
key_id = '6294476fdd87332fa23c6dd428f91c579e82bae012e98cd3a8f6b1043a40b4fb'
AND (
token = 'Y6gdb5MZwwRZf75lpdsoegnrukPVrYrTpAyaUFtaQVY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)