UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UMM7jSG9g9aTnjDVI0+85OryKWaQ7m+zoTLRzp4JLi8='
WHERE
key_id = 'f5b1c4594df12ebb14294aca559c59e09c7c21ff6b67d7ebccac01a3ed5ae60d'
AND (
token = 'UMM7jSG9g9aTnjDVI0+85OryKWaQ7m+zoTLRzp4JLi8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)