UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lVRXtgtG4uSMDnEfATYs5Cyts33s90+4ON8sQpiLvqs=' 
WHERE 
  key_id = '9ea80a5dfb752701883e199a8b57a6c1550eb1582f202ff1ce28cd241577bd91' 
  AND (
    token = 'lVRXtgtG4uSMDnEfATYs5Cyts33s90+4ON8sQpiLvqs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026