UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/OwahcGbtmU67nm2ij+dch8ud3a1A2hTh7mVGchziJk=' 
WHERE 
  key_id = 'e342e07cd14b27af1e4306a9bae1fa434f7353be5d4213d4d4b4974f5f044704' 
  AND (
    token = '/OwahcGbtmU67nm2ij+dch8ud3a1A2hTh7mVGchziJk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043