UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ouFZwPdJqOWMehwwtfclNa5DsGAAfhXXKWhGxHlAx20=' 
WHERE 
  key_id = 'e3f70e3385c2aac8b7ca9c69fa47b2d4b6a300553ac39723809f34679eddef2e' 
  AND (
    token = 'ouFZwPdJqOWMehwwtfclNa5DsGAAfhXXKWhGxHlAx20=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00082