UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fs4/DVG0cnJTX4jGEww7rITePRIgozis8TrxyF8tv8o=' 
WHERE 
  key_id = 'fb5878e8d977e2fe11b3d3d3c47cee2f6cb950070031b24062c957d463de9893' 
  AND (
    token = 'Fs4/DVG0cnJTX4jGEww7rITePRIgozis8TrxyF8tv8o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027