UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eN3KxSnSGC3VM04/odbH2kMviwE8rBCxuZP44pDcp28=' 
WHERE 
  key_id = '131aa0cf89ae3df8d6ccf4e8cad0565ee40ea2a80a9329bfda0ca73ef4236035' 
  AND (
    token = 'eN3KxSnSGC3VM04/odbH2kMviwE8rBCxuZP44pDcp28=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019