UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f9pvxnqvzVE58APgYQRREUj18dQsKXqI/IN7ahxk0Nc=' 
WHERE 
  key_id = '22a95a7ec99983b5a3bf4d168c4b0533968740d03bdf265c5ec5b57623e9c948' 
  AND (
    token = 'f9pvxnqvzVE58APgYQRREUj18dQsKXqI/IN7ahxk0Nc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036