UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wk4OHwo8Om1ik3GyJtHNUoxj7DYTBHp0XINdEww5NK4='
WHERE
key_id = '75bbdd153f17cde9572d3ce1e64a4716273226160c31cbbeb75cf6e6182f2a6d'
AND (
token = 'wk4OHwo8Om1ik3GyJtHNUoxj7DYTBHp0XINdEww5NK4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)