UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2YBgO7kQYeWbf4Te6d9fxXTa3elH4y6SCnXoNscfUKA=' 
WHERE 
  key_id = '9355d2c156e39af9698e86cecfedb2259c95368c60b1d750fa7bcbe65eb602b2' 
  AND (
    token = '2YBgO7kQYeWbf4Te6d9fxXTa3elH4y6SCnXoNscfUKA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033