UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZvuAo4Hn1yPKglz+ESFD32O9wLMEC6cqw7fZPkL0Wok='
WHERE
key_id = 'd03f1ef5c68eb5d27a7a856480e8b22803fe0e715470d53a63b398ced0c2d2a1'
AND (
token = 'ZvuAo4Hn1yPKglz+ESFD32O9wLMEC6cqw7fZPkL0Wok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)