UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4Un/7EznTRVgGcQ9w+NKKAWCPiwrReyY2vMfijUo19w=' 
WHERE 
  key_id = 'ee75b68bb97cec02ba043acf798e6a676b2e54932e40603ce72b9d4cd9e1f104' 
  AND (
    token = '4Un/7EznTRVgGcQ9w+NKKAWCPiwrReyY2vMfijUo19w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031