UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nxSNbpO9aQOp481MyKbd859/WjdTEPnAo04wBa/G9DE=' 
WHERE 
  key_id = '15541414675db363c7d753b0b78d6e902e77971c4a723b5135559c5d83df4b40' 
  AND (
    token = 'nxSNbpO9aQOp481MyKbd859/WjdTEPnAo04wBa/G9DE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024