UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EMrNk7dLuXeVlfcue4FusV2L42t9+1YMejsX1Gga9j8=' 
WHERE 
  key_id = '43728ac8ae3ef528333cef154838888fb27c62a3548bcbce63e5a88689675974' 
  AND (
    token = 'EMrNk7dLuXeVlfcue4FusV2L42t9+1YMejsX1Gga9j8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027