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

Query time 0.00047