UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rLOQha16rshtglLGptc78washoRyRly1irP4hIYWyWY='
WHERE
key_id = '0d6e6ecea96c1f6f0141db5cdd48b4a4ebf8b216896eba7cda489806728e0aac'
AND (
token = 'rLOQha16rshtglLGptc78washoRyRly1irP4hIYWyWY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)