UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qVlq/4pq87y4hx+9Ms8YZbzp/NMKuoP+sSztqyxKKq0='
WHERE
key_id = '507aa4eeafd7f38d6722c5559172f50c917cbb907509569412c3c261aa7c6d41'
AND (
token = 'qVlq/4pq87y4hx+9Ms8YZbzp/NMKuoP+sSztqyxKKq0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)