UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/2fXM++Z54bcpL5Blhh3tkUJYVrlx97ewsZ4Ox+EcU8='
WHERE
key_id = 'd5aabf0dd1e8ea99a1d098285c5e4f48985b6c02a07f6f98f058ae9caf74dbfd'
AND (
token = '/2fXM++Z54bcpL5Blhh3tkUJYVrlx97ewsZ4Ox+EcU8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)