UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1Yjy2l21oMdqOZBwZ5jYbfWL2zgIm0yDIfy/rabP+Eg=' 
WHERE 
  key_id = '03e7a8db96ba6c23eb50c8669e8f3b460ec70539f6621ce3eef0b9871a9621a5' 
  AND (
    token = '1Yjy2l21oMdqOZBwZ5jYbfWL2zgIm0yDIfy/rabP+Eg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023