UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ioOZMbbhfFxBthJnNKI34ZNx9KAfqBW+A0eiLroo8hI='
WHERE
key_id = '092e508387fb4e10287a75628ba625b92248544fb625dc0166fbd1ef873a0fb7'
AND (
token = 'ioOZMbbhfFxBthJnNKI34ZNx9KAfqBW+A0eiLroo8hI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)