UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G1r1qtUO1lycP5lMS/gjDkx//A718O4yLHz+aXN5q/8='
WHERE
key_id = '757c4308588e655ff8da4c44637fb4804d6ed70f1272feb46dc18017890d5b70'
AND (
token = 'G1r1qtUO1lycP5lMS/gjDkx//A718O4yLHz+aXN5q/8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)