UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rnl/AdYfbbgFkzBx5gNf4kf5BvFAHmpYG1d50ZBcbyg=' 
WHERE 
  key_id = '31744641655a6cc47408523bfdfbc543a2dbbc73f4c7e807ef4778b9ee64a395' 
  AND (
    token = 'rnl/AdYfbbgFkzBx5gNf4kf5BvFAHmpYG1d50ZBcbyg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015