UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tF3YTF4AjtTKPZlXFnOdFmv1OquctIoOfo4/RrlPOX0=' 
WHERE 
  key_id = '8ef25d0ca988662d8ebe48b2bbf20ae7b39fbfb03d426f4c2a708faa220ad526' 
  AND (
    token = 'tF3YTF4AjtTKPZlXFnOdFmv1OquctIoOfo4/RrlPOX0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017