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