UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QXh/VQcCVlCu77CtazSFtAzBcWU4HS8qJ6uBJLY2i1Y=' 
WHERE 
  key_id = '4abe2adfc2f2bc9314a99b3600683b95a55f5c18954c47be5249e985557b876a' 
  AND (
    token = 'QXh/VQcCVlCu77CtazSFtAzBcWU4HS8qJ6uBJLY2i1Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026